import axios from 'axios'

// axios基本配置
const api = axios.create({
	timeout: 30000,
	withCredentials: true
})
// 请求开始拦截
api.interceptors.request.use(conf => {
	return conf
},
	error => ({ status: 0, msg: error.message })
)
// 请求返回拦截
api.interceptors.response.use(response => {
    console.log(response.data);
	return Promise.resolve(response.data)
},
	error => {
		return Promise.resolve(error)
	}
)

export default api 